Non-Linear Correction

The non-linear correction attempt to correct for irregular oscillations appearing within acquisitions of both original and rotated images.

We assume that distortions are negligible within each line along the fast-scan direction, while certain x/y shifts among rigid scan lines are allowed. The evaluation, therefore, implies calculation of x/y shifts of each row in the image of original orientation (left) and x/y shifts of each column in the images of rotated orientation (right). The evaluation proceeds in two steps.

First, we divide a left image into representative horizontal stripes and compute cross-correlations with the corresponding stripes in the right image. Simularly, the right image is divided into vertical stripes that are correlated with the corresponding stripes in the left image. That provides the shift points, which are however too sparse and cannot be attributed to the individual row or column.

Second, we interpolate the resulted sparse shift points using a smooth cubic spline. The forthcoming back-mapping deforms all rows in the left image and all columns in the right one towards the companion reference.

Such shifts evaluation procedure might be not very accurate, thus several back-mapping iterations are typically required.


There are few settings to control the non-linear correction that you can access via Menu:

Linear correction setting

Number of Stripes

As explained above, the correction is based on dividing images into a certain number of stripes. You can set it via

Menu Setting → Non-linear → stripes.

This number is used mostly for moderate resolution images. For atomic-resolution ones, the number of stripes is determined automatically by analyzing the lattice period. However, you can disable the switch "use FFT" before non-linear correction, then the number of stripes will be defined by the value in this field.

atomic sampling

If the swich "use FFT" is activated, the number of stripes is determined automatically, based on dominant periodicity of the lattice. The later is deduced from the position of the most intensive peak in the FFT. Depending on the actual geometry of the lattice, this can be over of underestimation of the optimal number of stripes. The option "atomic sampling" alows to increase ("normal" → "dense") or decrease ("normal → "sparse") it twice.

Maximal Number of Iterations

the maximal number of iteration is defined via

Menu Setting → Non-linear → max iterations.

Typically, iterations are terminated earlier as the algorithm detects the convergence of the results.

Initial rate

Images are iteratively corrected by only a fraction of the measured shifts, otherwise the orrection might diverge. The value in

Menu Setting → Non-linear → initial rate.

defines the initial rate for the correction. The lower value implies conservative and slower iterations. This is however only valid for the beginning of iterations. Later, the rate will be adusted automatically based of the correction results.

Stopping criteria

Convergence is typically achieved within the smaller than maximal number of iterations. If the maximal shift at each iteration does not exceeds the value in

Menu Setting → Non-linear → maximal shift, the iterations stop.

Show Convergence Graph

As explain above, at each iteration, both images are deformed and their proximity is calculated. The convergence graph shows how the proximity improves with iterations. Different colors indicate attempts with different correction rate. It is a good practize to vizually control this process. This is done by looking at the convergence graph after termination of the correction.

Menu Setting → Non-linear → show convergence.

Shifts Convergence graph

fill value

After the correction, certain out-of-image areas will apear at the edges of both images. The value in

Menu Setting → Non-linear → fill value defines how to fill these areas.

The value should range from 0.0 to 1.0 where 0 means filling with the minimal value of images, 1.0 - maximal value and 0.5 - the average value of the raw images.

STEMCorrector Help – Index

Topics Index

Select a topic below: